import axios from 'axios';

const base = 'http://localhost:8081/api';

export function submitAnswers(data) {
    return axios.post(`${base}/mbti/submit`, data);
}

export function getResult(userId) {
    return axios.get(`${base}/mbti/result`, { params: { userId } });
}

export function getAllStudents() {
    return axios.get(`${base}/students`);
}

export function addStudent(data) {
    return axios.post(`${base}/students/add`, data);
}

export function deleteStudent(id) {
    return axios.delete(`${base}/students/delete/${id}`);
}

export function getClassStats() {
    return axios.get(`${base}/students/class-stats`);
}
